//Component Object
import {
  storeBindingsBehavior
} from "mobx-miniprogram-bindings";
import base from "@src/store/base";
Component({
  behaviors: [storeBindingsBehavior],
  storeBindings: [{
    store: base,
    fields: ['themeColor', 'themeTitleColor']
  }],
  properties: {
    isShow: {
      type: Boolean,
      value: false,
      observer(v) {
        const that = this
        v && wx.getSystemInfo({
          success: function (res) {
            that.setData({
              windowWidth: res.windowWidth, //可使用窗口宽度，单位px
              windowHeight: res.windowHeight, //可使用窗口高度，单位px
              isShowModal: v
            })
          },
        })
      }
    },
    days: {
      type: String,
      value: '',
      observer(v) {
        this.setData({
          flag: false
        })
      }
    }
  },
  data: {
    isShowModal: false,
    flag: true,
    windowWidth: '',
    windowHeight: '',
  },
  methods: {
    handerOk() {
      this.setData({
        isShowModal: false
      })
      this.triggerEvent('onOver', false);
    }
  },
});